<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.app.service.vo.CornCompetenceVo"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'main-role.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
	function manageDiv(src) {
		var divplay = document.getElementById(src).style.display;
		if (divplay == "") {
			document.getElementById(src).style.display = "none";
		} else {
			document.getElementById(src).style.display = "";
		}

	}
</script>
</head>

<body>
	<a href="javaScript:manageDiv('competencediv')">添加新权限</a>
	<table width="95%">
		<tr>
			<td>权限名</td>
			<td>操作</td>

		</tr>
		<%
			List<CornCompetenceVo> volist = (List<CornCompetenceVo>) request
					.getAttribute("competence-list");
			for (CornCompetenceVo vo : volist) {
		%>
		<tr>
			<td><%=vo.getName()%></td>
			<td><a href="<%=request.getContextPath()%>/competence/show.form?id=<%=vo.getId() %>">查看权限详细信息</a></td>

		</tr>

		<%
			}
		%>
	</table>
	<hr>
	<div id="competencediv" style="display:none">
		<form action="<%=request.getContextPath()%>/competence/add.form" method="post">
			<table width="95%">
				<tr>
					<td>权限名</td>
					<td><input type="text" name="name" /></td>

				</tr>
				<tr>
					<td>权限URL地址</td>
					<td><input type="text" name="url" /></td>

				</tr>
				<tr>
					<td>权限描述</td>
					<td><textarea rows="" cols="" name="competenceDescription"></textarea>
					</td>

				</tr>
				<tr>
					<td colspan="2"><input type="submit" value="增加新权限" /></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>